package com.party.business.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.party.business.domain.TComment;
import com.party.business.mapper.TCommentMapper;
import com.party.business.service.ITCommentService;
import com.party.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 评论Service业务层处理
 *
 * @author ruoyi
 * @date 2024-05-25
 */
@Service
public class TCommentServiceImpl extends ServiceImpl<TCommentMapper, TComment>  implements ITCommentService
{
    @Autowired
    private TCommentMapper tCommentMapper;

    /**
     * 查询评论
     *
     * @param id 评论主键
     * @return 评论
     */
    @Override
    public TComment selectTCommentById(String id)
    {
        return tCommentMapper.selectTCommentById(id);
    }

    /**
     * 查询评论列表
     *
     * @param tComment 评论
     * @return 评论
     */
    @Override
    public List<TComment> selectTCommentList(TComment tComment)
    {
        return tCommentMapper.selectTCommentList(tComment);
    }

    /**
     * 新增评论
     *
     * @param tComment 评论
     * @return 结果
     */
    @Override
    public int insertTComment(TComment tComment)
    {
                tComment.setCreateTime(DateUtils.getNowDate());
            return tCommentMapper.insertTComment(tComment);
    }

    /**
     * 修改评论
     *
     * @param tComment 评论
     * @return 结果
     */
    @Override
    public int updateTComment(TComment tComment)
    {
                tComment.setUpdateTime(DateUtils.getNowDate());
        return tCommentMapper.updateTComment(tComment);
    }

    /**
     * 批量删除评论
     *
     * @param ids 需要删除的评论主键
     * @return 结果
     */
    @Override
    public int deleteTCommentByIds(String[] ids)
    {
        return tCommentMapper.deleteTCommentByIds(ids);
    }

    /**
     * 删除评论信息
     *
     * @param id 评论主键
     * @return 结果
     */
    @Override
    public int deleteTCommentById(String id)
    {
        return tCommentMapper.deleteTCommentById(id);
    }
}
